<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;
// return [
//     '__pattern__' => [
//         'name' => '\w+',
//     ],
//     '[hello]'     => [
//         ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
//         ':name' => ['index/hello', ['method' => 'post']],
//     ],

// ];
Route::domain('', function () {
    Route::rule('/', 'index/index/index');
    Route::rule('/register/[:option]', 'index/index/register');
    // Route::rule('/login/[:option]', 'index/index/login');
    Route::rule('/user/[:option]', 'index/index/user');
    Route::rule('/guid/[:option]', 'index/index/guid');
     Route::rule('/guiddetail/[:option]', 'index/index/guiddetail');
    Route::rule('/report/[:option]', 'index/index/report');
    Route::rule('/play/[:option]', 'index/index/play');
});


// api子域名绑定闭包函数
Route::domain('api', function () {
    Route::rule('/', 'api/index/index');
    Route::rule('/user/[:option]', 'api/user/index');//注册api
    Route::rule('/images/[:option]', 'api/images/index');//图片api
});